#include "mylistwidget.h"
#include <QPushButton>
#include <QVBoxLayout>

MyListWidget::MyListWidget(QWidget *parent) :
    QWidget(parent)
{
    QStringList list;
    list << "1" << "2" << "3" << "4";
    model = new QStringListModel;
    model->setStringList(list);

    listView = new QListView(this);
    listView->setModel(model);

    QPushButton *showBtn = new QPushButton(tr("&Show"), this);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(listView);
    layout->addWidget(showBtn);

    setLayout(layout);
}
